<?php
/**
 * Модель session
 * 
 * Класс модели
 * @author Anton Zavidov
 * @package myLiveShop
 */

/**
 * Модель session
 *
 */
class ModelSession extends Model {
	
	const TABLE				= 'session';
	const F_KEY  	= 'key';
	const F_VALUE  	= 'value';
	const F_MODIFICATION  	= 'modification';
	const F_USER_ID  	= 'user_id';
	const F_HASH  	= 'hash';
			
	public function __construct($className=null){
		parent::__construct(__CLASS__);
		$this->name='session';
		$this->id_field=array(self::F_KEY);
		$this->fields=array(
		self::TABLE.DOT.self::F_KEY=> new Field($this,self::F_KEY,self::TABLE,array(
				'important'=>true,
				'lenght'=>32,
				'type'=>Field::TYPE_STRING)),
		self::TABLE.DOT.self::F_VALUE=> new Field($this,self::F_VALUE,self::TABLE,array(
				'type'=>Field::TYPE_TEXT)),
		self::TABLE.DOT.self::F_MODIFICATION=> new Field($this,self::F_MODIFICATION,self::TABLE,array(
				)),
		self::TABLE.DOT.self::F_USER_ID=> new Field($this,self::F_USER_ID,self::TABLE,array(
				'important'=>true,
				'lenght'=>9,
				'join_table'=>'user')),
		self::TABLE.DOT.self::F_HASH=> new Field($this,self::F_HASH,self::TABLE,array(
				'lenght'=>32,
				'type'=>Field::TYPE_STRING))		);
	}
}
